"""
create table user(
    id int primary key,
    nickname varchar(32),
    username varchar(64),
    pwd varchar(128),
    avatar varchar(255),
    email varchar(128),
    last_login_time datetime,
    create_time datetime,
    update_time datetime,
    status int,
    is_superuser int,
    language varchar(32),
    color_schema varchar(32),
    timezone varchar(32),
    is_authenticated varchar(1),
    is_active varchar(1),
    is_anonymous varchar(1),
    login_channel varchar(1)
)
"""

from datetime import datetime

from sqlalchemy import Column, String, DateTime, Integer
import uuid

from api.utils.base import Base


class User(Base):
    __tablename__= "t_user"
    id = Column(String, primary_key=True)
    nickname = Column(String,comment="暱称")
    username = Column(String,comment="用户名")
    pwd = Column(String,comment="密码")
    avatar = Column(String,comment="头像")
    email = Column(String,comment="邮箱")
    last_login_time = Column(DateTime, comment="上次登录时间")
    create_time = Column(DateTime, comment="创建时间", default=datetime.now)
    update_time = Column(DateTime,comment="更新时间", default=datetime.now)
    status = Column(Integer,comment="状态", default="1")
    is_superuser = Column(String, comment="是否是超级用户", default="0")
    language = Column(String, comment="语言", default="chinese")
    color_schema = Column(String, comment="主题", default="light")
    timezone = Column(String, comment="时区", default="GMT+8")
    is_authenticated = Column(String, comment="是否授权", default="1")
    is_active = Column(String, comment="是否激活", default="1")
    is_anonymous = Column(String, comment="是否匿名", default="1")
    login_channel = Column(String, comment="登录渠道", default="web")
